home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / layout / nsIComboboxControlFrame.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  132 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIComboboxControlFrame_h___
  39. #define nsIComboboxControlFrame_h___
  40.  
  41. #include "nsISupports.h"
  42. #include "nsFont.h"
  43.  
  44. class nsPresContext;
  45. class nsString;
  46. class nsIContent;
  47. class nsVoidArray;
  48. class nsCSSFrameConstructor;
  49.  
  50.  
  51. // IID for the nsIComboboxControlFrame class
  52. #define NS_ICOMBOBOXCONTROLFRAME_IID    \
  53. { 0x6961f791, 0xa662, 0x11d2,  \
  54.   { 0x8d, 0xcf, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
  55.  
  56. /** 
  57.   * nsIComboboxControlFrame is the common interface for frames of form controls. It
  58.   * provides a uniform way of creating widgets, resizing, and painting.
  59.   * @see nsLeafFrame and its base classes for more info
  60.   */
  61. class nsIComboboxControlFrame : public nsISupports {
  62.  
  63. public:
  64.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOMBOBOXCONTROLFRAME_IID)
  65.  
  66.   /**
  67.    * Indicates whether the list is dropped down
  68.    */
  69.   NS_IMETHOD IsDroppedDown(PRBool * aDoDropDown) = 0;
  70.  
  71.   /**
  72.    * Shows or hides the drop down
  73.    */
  74.   NS_IMETHOD ShowDropDown(PRBool aDoDropDown) = 0;
  75.  
  76.   /**
  77.    * Gets the Drop Down List
  78.    */
  79.   NS_IMETHOD GetDropDown(nsIFrame** aDropDownFrame) = 0;
  80.  
  81.   /**
  82.    * Sets the Drop Down List
  83.    */
  84.   NS_IMETHOD SetDropDown(nsIFrame* aDropDownFrame) = 0;
  85.  
  86.   /**
  87.    * Tells the combobox to roll up
  88.    */
  89.   NS_IMETHOD RollupFromList(nsPresContext* aPresContext) = 0;
  90.  
  91.   /**
  92.    * Redisplay the selected text (will do nothing if text has not changed)
  93.    */
  94.   NS_IMETHOD RedisplaySelectedText() = 0;
  95.  
  96.   /**
  97.    * Method for the listbox to set and get the recent index
  98.    */
  99.   NS_IMETHOD_(PRInt32) UpdateRecentIndex(PRInt32 aIndex) = 0;
  100.  
  101.   /**
  102.    *
  103.    */
  104.   NS_IMETHOD AbsolutelyPositionDropDown() = 0;
  105.  
  106.   /**
  107.    *
  108.    */
  109.   NS_IMETHOD GetAbsoluteRect(nsRect* aRect) = 0;
  110.  
  111.   /**
  112.    * This returns the index of the item that is currently being displayed
  113.    * in the display area. It may differ from what the currently Selected index
  114.    * is in in the dropdown.
  115.    *
  116.    * Detailed explanation: 
  117.    * When the dropdown is dropped down via a mouse click and the user moves the mouse 
  118.    * up and down without clicking, the currently selected item is being tracking inside 
  119.    * the dropdown, but the combobox is not being updated. When the user selects items
  120.    * with the arrow keys, the combobox is being updated. So when the user clicks outside
  121.    * the dropdown and it needs to roll up it has to decide whether to keep the current 
  122.    * selection or not. This method is used to get the current index in the combobox to
  123.    * compare it to the current index in the dropdown to see if the combox has been updated
  124.    * and that way it knows whether to "cancel" the the current selection residing in the 
  125.    * dropdown. Or whether to leave the selection alone.
  126.    */
  127.   NS_IMETHOD GetIndexOfDisplayArea(PRInt32* aSelectedIndex) = 0;
  128. };
  129.  
  130. #endif
  131.  
  132.